(* 
  CS520 Project
  William Blair
  wblair@bu.edu
  
  The main flow of control for the generator
*)

staload "random.sats"
staload "generator.sats"

staload "prelude/SATS/sizetype.sats"

staload "libats/SATS/parworkshop.sats"
staload "libats/DATS/parworkshop.dats"

assume gen_string = String

implement main() = let
  val () = generator_setup()
  (* Read in the Config File *)
  val config = load_file("../config.json")
  val generators = input_parse_generators(config)
  (* Create the resource threads. *)
  val ws = workshop_make<generator>(1, generator_resource)
  val () = generator_dispatch(ws,generators)
  val () = workshop_wait_quit_all(ws)
  val () = workshop_free(ws)
  in end
